home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 5855 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.2 KB  |  79 lines

  1. Path: sdcc12.ucsd.edu!cs!galvarez
  2. From: galvarez@cs.ucsd.edu (Guillermo Alvarez)
  3. Newsgroups: comp.sys.cbm
  4. Subject: Re: Unlock Disk, 1541
  5. Date: 19 Apr 1996 19:09:20 GMT
  6. Organization: CSE Dept., UC San Diego
  7. Distribution: world
  8. Message-ID: <4l8od0$eng@sdcc12.ucsd.edu>
  9. References: <3176F97B.1390@esbjehs.dk> <3177c00b.1948181@199.181.141.3>
  10. NNTP-Posting-Host: beowulf.ucsd.edu
  11.  
  12.  
  13. What Tony suggests is true; however, I did it much more easily in my
  14. 1571 several years ago.  I had a ROM disassembly of the drive, and there
  15. I found the couple of instructions that checked for this special value
  16. on the disk.  I simply copied the whole ROM to RAM, altered this couple
  17. of bytes so that the result of the test would be irrelevant, and changed
  18. the memory map of the drive to use the modified routines in RAM.  I then
  19. used the DOS interface as usual to overwrite the sector, and got the job
  20. done.
  21.  
  22. Guillermo
  23.  
  24. In article <3177c00b.1948181@199.181.141.3>, Tony Postmayer (tonyp@wizvax.wizvax.net) writes:
  25. |> On Thu, 18 Apr 1996 19:24:59 -0700, Ejner <d6kn@esbjehs.dk> wrote:
  26. |> 
  27. |> >Does anyone know how to unlock a locked disk (1541 formattet) ?
  28. |> >It has been locked by changing the $41 value in position 2 of track 18, 
  29. |> >sector 00... Instead of $41, it now reads $42... When I try changing it 
  30. |> >back, it fails, ┤coz it thinks the disk is another format than 1541...
  31. |> >How can I change it back? I use MC...
  32. |> >
  33. |> >Notice: I have programs for it, but I want to know how!! :-)
  34. |> >
  35. |> Essentially, you have to read the sector into memory, make the desired
  36. |> alterations, and write it back out.  The trick is you have to write it
  37. |> out without using the 1541 DOS in order to avoid the error detection
  38. |> that is stopping you.
  39. |> 
  40. |> No doubt there are shortcut ways to do this, perhaps by doing a little
  41. |> preliminary setup and then calling some 1541 ROM routines directly.  A
  42. |> lot of that stuff has been written up in magazines over the years.  I
  43. |> prefer to do it the hard way which is to control the entire process
  44. |> though machine code routines which execute in the drive.  I only call
  45. |> a minimum of ROM routines, such as the GCR conversion ones.
  46. |> 
  47. |> This is by no means a simple feat.  You have to be a top notch ML
  48. |> programmer and have good information on the architecture of the drive.
  49. |> (for example, a copy of the book Inside Commodore DOS)
  50. |> 
  51. |> My advice to you, if you want to take up the challenge, is to get a
  52. |> copy of one of the many fast format routines and disassemble it.  When
  53. |> you've studied that and learned all the steps needed to format a 1541
  54. |> disk you'll be able to solve your present problem as well as many
  55. |> more.  I recommend the format code from the "Fast Hack Em" disk
  56. |> utility - it's the most direct and concise one I've seen.
  57. |> 
  58. |> Just to give you an idea, here's a rough flowchart of what has to be
  59. |> done:
  60. |> 
  61. |>     Turn the motor on and give it time to come up to speed
  62. |>     Figure out what track you are on
  63. |>     Step the head to the target track
  64. |>     Seek the target sector
  65. |>     Read in the target data block
  66. |>     Convert from GCR to Petscii
  67. |>     
  68. |>     Make your alterations
  69. |> 
  70. |>     Convert from Petscii to GCR
  71. |>     Seek the target sector
  72. |>     Write out the data
  73. |>     Shut everything down
  74. |> 
  75. |> Good luck.
  76. |> 
  77. |>   Tony -
  78. |> 
  79.